<#include "../common/layout.ftl"/>
<@layout>
<div width="100%">
	<div class="dxfsqd_title">VIP客户会员</div>
	<div class="dxfsqd_shearch">
	<form method="post" action="/vipmember" class="form-inline">
		<#if session.userRole == 'admin' || session.userRole == 'brandManager'>
			<label><span>姓名：</span><input type="text" class="input-medium" style="height: 30px"  name="real_name" value="${real_name?if_exists}"/></label> 
			<label><span>手机号码：</span><input type="text" class="input-medium" style="height: 30px"  name="cell_phone" value="${cell_phone?if_exists}"/></label> 
			<input type="hidden" value="${type}" name="type">
			<button type="submit" class="btn btn-primary"><i class="icon-search icon-white"></i>查询</button>
		</#if>
		<#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
			<#if type?exists>
				<#if type=='0'>
					<a class="dc_exc" style="background: red;" href="/vipmember?type=0"><i class="icon-user icon-white"></i>个人VIP</a>
					<a class="dc_exc" href="/vipmember?type=1"><i class="icon-user icon-white"></i>企业VIP</a>
				<#else>
					<a class="dc_exc" href="/vipmember?type=0"><i class="icon-user icon-white"></i>个人VIP</a>
					<a class="dc_exc" style="background: red;" href="/vipmember?type=1"><i class="icon-user icon-white"></i>企业VIP</a>
				</#if>
			<#else>
				<a class="dc_exc" href="/vipmember?type=0"><i class="icon-user icon-white"></i>个人VIP</a>
				<a class="dc_exc" href="/vipmember?type=1"><i class="icon-user icon-white"></i>企业VIP</a>
			</#if>
		</#if>
		<#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
			<#if type?exists && type=='1'>
				<a class="dc_exc" href="/vipmember/add"><i class="icon-user icon-white"></i>添加VIP</a>
				<#if session.userRole == 'admin' || session.userRole == 'brandManager'>
					<label><span>导出</span><a class="dc_exc" href="/vipmember/exportXls/1">导出Excel文件</a></label>
	    		</#if>
	    	<#else>
	    		<#if session.userRole == 'admin' || session.userRole == 'brandManager'>
	    			<label><span>导出</span><a class="dc_exc" href="/vipmember/exportXls/0">导出Excel文件</a></label>
	    		</#if>
			</#if>
		</#if>
	</form>
  </div>

<div class="dxfsqd_table">
    <#if type?exists && type=='0'>
	<table class="table table-bordered table-striped">
		<thead>
		  <tr>
			<th scope="col">ID</th>
			<th scope="col">姓名</th>
			<th scope="col">手机号码</th>
			<th scope="col">性别</th>
			<th scope="col">车牌号码</th>
			<th scope="col">是否签单</th>
			<th scope="col">订单量</th>
			<th scope="col">订单额</th>
			<th scope="col">账户余额</th>
			<th scope="col">身份证</th>
			<th scope="col">邮件</th>
			<th scope="col">常用地址</th>
			<th scope="col">注册时间</th>
			<th scope="col">状态</th>
			<th scope="col">备注</th>
			<th scope="col">操作</th>
		  </tr>
		</thead>
		<tbody>
		<#list page.list as member>
		  <tr>
			<td>
			  <span class="label">${member.id}</span>
			</td>
			<td>
			  <#if member.user_type==0>
			  ${member.real_name}
			  </#if>
			  <#if member.user_type==1>
			  ${member.user_name}
			  </#if>
			</td>
			<td>
			  ${member.cell_phone!""}
			</td>
			<td>
			  <#if member.sex??>
			  <#if member.sex == 0>
			  	<span class="label label-info">男</span>
			  <#elseif member.sex == 1>
			  	<span class="label label-warning">女</span>
			  <#else>
			  	<span class="label label-inverse">未知</span>
			  </#if>
			  </#if>
			</td>
			<td>
			  ${member.plage_number!""}
			</td>
			<td>
			   <#if member.is_deal??>
			  <#if member.is_deal == 0>
			  	<span class="label label-info">否</span>
			  <#elseif member.is_deal == 1>
			  	<span class="label label-warning">是</span>
			  <#else>
			  	<span class="label label-inverse">未知</span>
			  </#if>
			  </#if>
			<td>
			
			  ${member.order_count!""}
			</td>
			<td>
			  ${member.sum_money!"0"}
			</td>
			<td>
				<#if member.balance??>
					￥${member.balance?string(",##0.00#")}
				<#else>
					0.0
				</#if>
			</td>
			<td>
			  ${member.card_id!""}
			</td>
			<td>
			  ${member.email_no!""}
			</td>
			<td>
			  ${member.endpoint!""}
			</td>
			<td>
			   <#if member.create_time??> 
			    ${member.create_time?string("yyyy年MM月dd日HH时mm分ss秒") }  
			   </#if>  
			</td>
			<td>
			  <#if member.status == 1>
			  	<span class="label label-success">正常</span>
			  <#elseif member.status == 2>
			  	<span class="label label-inverse">黑名单</span>
			  <#else>
			  	<span class="label label-info">已删除</span>
			  </#if>
			</td>
			<td>
			  ${member.remark!""}
			</td>
			<td>
				<div class="btn-group">
					 
					 <a class="cf" href="/vipmember/edit/${member.id}"><i class="icon-info-sign icon-white"></i> 修 改</a>
					 <a class=cf" href="/vipmember/todeposit/${member.id}"><i class="icon-info-sign icon-white"></i> 充值</a>
					 <#if session.userId == 1>
					 <a class="cf" href="/vipmember/delete/${member.id}"><i class="icon-trash icon-white"></i> 删 除</a>
					 </#if>
					 <#if session.userRole == 'admin' || session.userRole == 'brandManager'>
					 	<a class="cf" href="/vipmember/operator?id=${member.id}"><i class="icon-trash icon-white"></i> 充值记录</a>
					 </#if>
					 <!-- <a class="btn btn-primary" href="/vipmember/black/${member.id}"><i class="icon-trash icon-white"></i> 黑名单</a> -->
				</div>
			</td>
		  </tr>
		</#list>
		</tbody>
	</table>  
	</#if>
	 <#if type?exists && type=='1'>
	<table class="table table-bordered table-striped">
		<thead>
		  <tr>
			<th scope="col">ID</th>
			<th scope="col">企业名称</th>
			<th scope="col">联系人</th>
			<th scope="col">联系电话</th>
			<th scope="col">单位地址</th>
			<th scope="col">是否签单</th>
			<th scope="col">使用人</th>
			<th scope="col">使用电话</th>
			<th scope="col">订单量</th>
			<th scope="col">订单额</th>
			<th scope="col">账户余额</th>
			<th scope="col">注册时间</th>
			<th scope="col">状态</th>
			<th scope="col">备注</th>
			<th scope="col">操作</th>
		  </tr>
		</thead>
		<tbody>
		<#list page.list as member>
		  <tr>
			<td>
			  <span class="label">${member.id}</span>
			</td>
			<td>
			  <#if member.user_type==1>
			  ${member.user_name}
			  </#if>
			</td>
			<td>
			  ${member.real_name!""}
			</td>
			<td>
				${member.cell_phone!""}
			</td>
			<td>
			  ${member.adds!""}
			</td>
			<td>
			   <#if member.is_deal??>
			  <#if member.is_deal == 0>
			  	<span class="label label-info">否</span>
			  <#elseif member.is_deal == 1>
			  	<span class="label label-warning">是</span>
			  <#else>
			  	<span class="label label-inverse">未知</span>
			  </#if>
			  </#if>
			</td>
			<td>
				<#if member.name??>
					${member.name!""}
				<#else>
					
				</#if>
			</td>
			<td>
				${member.telephone!""}
			</td>
			<td>
			  ${member.order_count!""}
			</td>
			<td>
			  ${member.sum_money!"0"}
			</td>
			<td>
				<#if member.balance??>
					￥${member.balance?string(",##0.00#")}
				<#else>
					0.0
				</#if>
			</td>
			<td>
			   <#if member.create_time??> 
			    ${member.create_time?string("yyyy年MM月dd日HH时mm分ss秒") }  
			   </#if>  
			</td>
			<td>
			  <#if member.status == 1>
			  	<span class="label label-success">正常</span>
			  <#elseif member.status == 2>
			  	<span class="label label-inverse">黑名单</span>
			  <#else>
			  	<span class="label label-info">已删除</span>
			  </#if>
			</td>
			<td>
			  ${member.remark!""}
			</td>
			<td>
				<div class="btn-group">
					 
					 <a class="cf" href="/vipmember/edit/${member.id}"><i class="icon-info-sign icon-white"></i> 修 改</a>
					 <a class="cf" href="/vipmember/todeposit/${member.id}"><i class="icon-info-sign icon-white"></i> 充值</a>
					 <#if session.userId == 1>
					 <a class="cf" href="/vipmember/delete/${member.id}"><i class="icon-trash icon-white"></i> 删 除</a>
					 </#if>
					 <#if session.userRole == 'admin' || session.userRole == 'brandManager'>
					 	<a class="cf" href="/vipmember/operator?id=${member.id}"><i class="icon-trash icon-white"></i> 充值记录</a>
					 </#if>
					 <!-- <a class="btn btn-primary" href="/vipmember/black/${member.id}"><i class="icon-trash icon-white"></i> 黑名单</a> -->
				</div>
			</td>
		  </tr>
		</#list>
		</tbody>
	</table>  
	</#if>
	<#include "../common/paginate.ftl" />
	<@paginate currentPage=page.pageNumber totalPage=page.totalPage actionUrl="/vipmember/" urlParas="?type=${type}" />
</div>
</div>
          
</@layout>